from django.db import models


class Class1(models.Model):
    id = models.AutoField
    name = models.CharField(max_length=32)


class Student(models.Model):
    id = models.AutoField
    name = models.CharField(max_length=32)
    class1 = models.ForeignKey(to=Class1, related_name='students', on_delete=models.CASCADE)


class Teacher(models.Model):
    id = models.AutoField
    name = models.CharField(max_length=32)
    classes = models.ManyToManyField(to='Class1', related_name='teachers')
